package xyz.xtt.pay.service;

import xyz.xtt.pay.api.enums.PayOrderBusinessTypeEnum;
import xyz.xtt.pay.dto.pay.GoodsInfo;
import xyz.xtt.pay.entity.TblPayOrder;
import xyz.xtt.pay.vo.CreateOrderRequest;
import xyz.xtt.pay.vo.PayCallbackMessage;
import xyz.xtt.pay.vo.PayCenterArgsResponse;
import xyz.xtt.user.client.response.UserInfoResponse;

public interface IPayOrderOperator {
	public static final int CAN_SELL_PATTERN = 1;

	/**
	 * 是否支持该类型的订单
	 * 
	 * @param type
	 * @return
	 */
	boolean canOperateType(PayOrderBusinessTypeEnum type);

	/**
	 * 创建订单
	 * 
	 * @param tblUser
	 * @param orderTypeEnum
	 * @param request
	 * @return
	 */
	PayCenterArgsResponse createPayOrder(UserInfoResponse tblUser, PayOrderBusinessTypeEnum orderTypeEnum, CreateOrderRequest request, GoodsInfo goodsInfo);

	/**
	 * 确认支付订单
	 * 
	 * @param payOrder
	 * @param callbackMessage
	 * @param appUserId
	 * @return
	 */
	boolean confirmPayOrder(TblPayOrder payOrder, PayCallbackMessage callbackMessage, String appUserId);

	/**
	 * 取消支付订单
	 * 
	 * @param payOrder
	 * @param reason
	 */
	void doPayCancel(TblPayOrder payOrder, String reason);

	GoodsInfo getGoodsInfo(TblPayOrder payOrder);

}
